package com.rm.zeyou.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.rm.zeyou.entity.Technician;
import com.rm.zeyou.response.ApiRestResponse;
import com.rm.zeyou.service.TechnicianShieldService;
import com.rm.zeyou.util.login.TechnicianLoginUtil;
import com.rm.zeyou.vo.request.AddTechnicianShieldVo;
import com.rm.zeyou.vo.response.SelectTechnicianShieldListResponseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 技师屏蔽用户表 前端控制器
 * </p>
 *
 * @author YanYang
 * @since 2025-03-12 15:55:09
 */
@Api(tags = "技师屏蔽用户相关")
@RestController
@RequestMapping("/api/technicianShield")
public class TechnicianShieldController {
    @Resource
    private TechnicianShieldService technicianShieldService;
    @Resource
    private TechnicianLoginUtil technicianLoginUtil;

    @ApiOperation(value = "添加技师不想被看用户")
    @PostMapping("addTechnicianShield")
    @SaCheckLogin(type = "technician")
    public ApiRestResponse<Integer> addTechnicianShield(@RequestBody AddTechnicianShieldVo addVo) {
        Technician technician = technicianLoginUtil.getTechnician();
        return technicianShieldService.addTechnicianShield(technician.getId(),addVo);
    }

    @ApiOperation(value = "查看技师不想被看用户列表")
    @PostMapping("selectTechnicianShieldList")
    @SaCheckLogin(type = "technician")
    public ApiRestResponse<List<SelectTechnicianShieldListResponseVo>> selectTechnicianShieldList() {
        Technician technician = technicianLoginUtil.getTechnician();
        return technicianShieldService.selectTechnicianShieldList(technician.getId());
    }


    @ApiOperation(value = "技师删除不想被看用户")
    @GetMapping("technicianDeleteShield")
    @SaCheckLogin(type = "technician")
    public ApiRestResponse<Integer> technicianDeleteShield(@RequestParam Long id) {
        Technician technician = technicianLoginUtil.getTechnician();
        return technicianShieldService.technicianDeleteShield(technician.getId(),id);
    }
}
